package org.afs.gescol.gwt.client.service;

import java.util.List;

import org.afs.gescol.gwt.shared.GlobalConstantesModel;
import org.scub.foundation.framework.gwt.module.client.exception.GwtRunTimeExceptionGwt;
import org.scub.foundation.framework.gwt.module.shared.IdLabelModel;

import com.bradrydzewski.gwt.calendar.client.Appointment;
import com.google.gwt.core.client.GWT;
import com.google.gwt.user.client.rpc.RemoteService;
import com.google.gwt.user.client.rpc.RemoteServiceRelativePath;

/**
 * For all services that get informations to manage on client side.
 * @autor Kobla GBENYO (kobla.gbenyo@gmail.com)
 */
@RemoteServiceRelativePath("handler/getServices")
public interface GetServicesGwt extends RemoteService {

    /** For getting instance of async service. */
    public static final class App {
        private static GetServicesGwtAsync app = null;

        /**
         * Private Constructor.
         */
        private App() {}

        /**
         * Get async service instance.
         * @return the service.
         */
        public static synchronized GetServicesGwtAsync getInstance() {
            if (app == null) {
                app = (GetServicesGwtAsync) GWT.create(GetServicesGwt.class);
            }
            return app;
        }
    }

    /**
     * Get the app constantes.
     * @return the constantes
     * @throws GwtRunTimeExceptionGwt Gwt error
     */
    GlobalConstantesModel getGlobalConstantesModel() throws GwtRunTimeExceptionGwt;

    /**
     * Get a school class by name.
     * @param name the school class
     * @return the classes
     * @throws GwtRunTimeExceptionGwt Gwt error
     */
    List<IdLabelModel> getClassByName(String name) throws GwtRunTimeExceptionGwt;

    /**
     * Get a school cycle by name.
     * @param name the school cycle
     * @return the cycle
     * @throws GwtRunTimeExceptionGwt Gwt error
     */
    List<IdLabelModel> getCycleByName(String name) throws GwtRunTimeExceptionGwt;

    /**
     * Get a school year by name.
     * @param name the school year
     * @return the year
     * @throws GwtRunTimeExceptionGwt Gwt error
     */
    List<IdLabelModel> getAnneeByName(String name) throws GwtRunTimeExceptionGwt;

    /**
     * Get a school period by name.
     * @param name the school period
     * @return the period
     * @throws GwtRunTimeExceptionGwt Gwt error
     */
    List<IdLabelModel> getPeriodeByName(String name) throws GwtRunTimeExceptionGwt;

    /**
     * Get a school cycle by user.
     * @param userId the school cycle
     * @return the cycle
     * @throws GwtRunTimeExceptionGwt Gwt error
     */
    List<IdLabelModel> getCycleByUser(Long userId) throws GwtRunTimeExceptionGwt;

    /**
     * Get a school period by year.
     * @param anneeId the school period
     * @return the period
     * @throws GwtRunTimeExceptionGwt Gwt error
     */
    List<IdLabelModel> getPeriodeByAnnee(Long anneeId) throws GwtRunTimeExceptionGwt;

    /**
     * Get a genre / civility of person.
     * @param idTypePersonne type of person
     * @param start start char
     * @return the genre
     * @throws GwtRunTimeExceptionGwt Gwt error
     */
    List<IdLabelModel> getGenreByTypePersonne(Long type, String start) throws GwtRunTimeExceptionGwt;

    /**
     * Get a oui / non list.
     * @param start start char
     * @return the list
     * @throws GwtRunTimeExceptionGwt Gwt error
     */
    List<IdLabelModel> getOuiNon(String start) throws GwtRunTimeExceptionGwt;

    /**
     * Get a statut (ancien / nouveau) list.
     * @param startName start char of name
     * @return the list
     * @throws GwtRunTimeExceptionGwt Gwt error
     */
    List<IdLabelModel> getStatutByName(String startName) throws GwtRunTimeExceptionGwt;

}